//
//  SEGVisitorAccessHistoryModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/5/16.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGVisitorAccessHistoryModel.h"
#import "SEGVisitorAccessDoorModel.h"

@implementation SEGVisitorAccessHistoryModel

- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        _hasNum = @"";
        _doorIds = @"";
        _visitorTel = @"";
        _ownAddr = @"";
        _allowableNum = @"";
        _visitorDoors = [NSArray array];
        _visitorCarCode = @"";
        _communityId = @"";
        _vistLogid = @"";
        _visitorName = @"";
        _createTime = @"";
        _houseId = @"";
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}
- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{}

- (void)setValue:(id)value forKey:(NSString*)key
{
    //    if ([key isEqualToString:@"visitorDoors"]) {
    if ([value isKindOfClass:[NSArray class]]) {
        NSMutableArray* _arrM = [NSMutableArray array];
        for (NSDictionary* dict in value) {
            SEGVisitorAccessDoorModel* model = [SEGVisitorAccessDoorModel yy_modelWithDictionary:dict];
            [_arrM addObject:model];
        }
        _visitorDoors = _arrM.copy;
        return;
    }
    
    [super setValue:value forKey:key];
}

- (void)setHasNum:(NSString*)hasNum{
    _hasNum = [[SEGUtils ValueToString:hasNum]copy];
}
- (void)setDoorIds:(NSString*)doorIds{
    _doorIds = [[SEGUtils ValueToString:doorIds]copy];
}
- (void)setVisitorTel:(NSString*)visitorTel{
    _visitorTel = [[SEGUtils ValueToString:visitorTel]copy];
}
- (void)setOwnAddr:(NSString*)ownAddr{
    _ownAddr = [[SEGUtils ValueToString:ownAddr]copy];
}
- (void)setAllowableNum:(NSString*)allowableNum{
    _allowableNum = [[SEGUtils ValueToString:allowableNum]copy];
}
- (void)setVisitorDoors:(NSString*)visitorDoors{
    _visitorDoors = [[SEGUtils ValueToString:visitorDoors]copy];
}
- (void)setVisitorCarCode:(NSString*)visitorCarCode{
    _visitorCarCode = [[SEGUtils ValueToString:visitorCarCode]copy];
}
- (void)setCommunityId:(NSString*)communityId{
    _communityId = [[SEGUtils ValueToString:communityId]copy];
}
- (void)setVistLogid:(NSString*)vistLogid{
    _vistLogid = [[SEGUtils ValueToString:vistLogid]copy];
}
- (void)setVisitorName:(NSString*)visitorName{
    _visitorName = [[SEGUtils ValueToString:visitorName]copy];
}
- (void)setCreateTime:(NSString*)createTime{
    _createTime = [[SEGUtils ValueToString:createTime]copy];
}
- (void)setHouseId:(NSString *)houseId {
    _houseId = [[SEGUtils ValueToString:houseId]copy];
}

@end
